//
//  JHSWeatherModel.m
//  JHSSweep
//
//  Created by YanYaxing on 2017/3/25.
//  Copyright © 2017年 JHDS. All rights reserved.
//

#import "JHSWeatherModel.h"
#import "JHSNetworkTool.h"


@implementation JHSWeatherModel

+ (void)weatherNetDataWithURL:(NSString *)urlStr withParameters:(id)parameters withSuccessBlock:(void(^)(id responceBoby))successBK withFailureBlock:(void(^)(NSError *error))failureBK{
    
    JHSNetworkTool *tool = [JHSNetworkTool shareManager];
    
    tool.requestSerializer = [[AFHTTPRequestSerializer alloc] init];
    
    [tool postWithURLStr:urlStr withParameters:parameters withSuccessBlock:^(id responseBody) {
//        NSArray *dicArr = responseBody[@"data"][@"banners"];
        NSArray *result = responseBody[@"results"];
        NSDictionary *resultDict = result.firstObject;
        NSArray *weatherData = resultDict[@"weather_data"];
        NSDictionary *weatherDataDict = weatherData.firstObject;
        successBK(weatherDataDict);
        
    } withFailureBlock:^(NSError *error) {
        failureBK(error);
    }];
    
    
}



- (NSString *)description
{
    return [self yy_modelDescription];
}

@end
